package bll

import (
	"jgt-oper/src/model"
	"jgt-oper/src/schema"
)

// Notice 通知发布
type Notice struct {
	NoticeModel model.INotice `inject:"INotice"`
}

// Create 创建通知
func (a *Notice) Create(item *schema.Notice) error {
	return a.NoticeModel.Create(item)
}

// Get 查询通知详情
func (a *Notice) Get(recordID string) (*schema.Notice, error) {
	return a.NoticeModel.Get(recordID)
}

// QueryPage 查询分页
func (a *Notice) QueryPage(params *schema.NoticeQParams, pageIndex, pageSize uint) (int, []*schema.Notice, error) {
	return a.NoticeModel.QueryPage(params, pageIndex, pageSize)
}

// Update 更新通知
func (a *Notice) Update(recordID string, info map[string]interface{}) error {
	return a.NoticeModel.Update(recordID, info)
}
